package com.epoint.mobileoa.tools;

/**
 * @author liyc
 * @time 2012-5-14 下午8:57:49
 * @annotation 算法帮助类
 */
public class Arithmetic {
	
	//冒泡排序
	public static int[] sort(int[] mp){
		for (int i = 0; i < mp.length; i++) {
			for (int j = 0; j < mp.length; j++) {
				int temp;
				if (mp[i] < mp[j]) {
					temp = mp[j];
					mp[j] = mp[i];
					mp[i] = temp;
				}
			}
		}
		return mp;
	}
	
	//冒泡排序
	public static Long[] sort(Long[] mp){
		for (int i = 0; i < mp.length; i++) {
			for (int j = 0; j < mp.length; j++) {
				Long temp;
				if (mp[i] < mp[j]) {
					temp = mp[j];
					mp[j] = mp[i];
					mp[i] = temp;
				}
			}
		}
		return mp;
	}
	
}
